In conducting an optical inspection on a three-dimensional structural device, there has been known a technique of inspecting patterns on, for example, stepwise portions with a difference in elevation.
According to the known technique, however, it is necessary to acquire a plurality of images while changing a focus value of an optical system depending on heights of an inspection target. This necessity results in not only a long inspection time, but also a difference in sensitivity due to variations in focus for each image acquisition, which may exert influence on inspection accuracy. In addition, a next-generation device includes an increased number of stacked layers. It is therefore obvious that an inspection time becomes longer conspicuously.